package cn.lingyangwl.agile.system.model.rqrs.dept;

import cn.lingyangwl.framework.tool.core.tree.TreeNode;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * 部门
 * @author shenguangyang
 */

@Getter
@Setter
public class DeptResp extends DeptBase implements TreeNode<Long, DeptResp> {
    private static final long serialVersionUID = 1L;

    private Long id;

    /** 父部门ID */
    private Long parentId;

    private String key;

    /** 前端数据树中的value*/
    private String value;

    /** 前端数据树中的title */
    private String title;

    private List<DeptResp> children = new ArrayList<>();

    @Override
    public Long treeId() {
        return this.id;
    }

    @Override
    public void treeId(Long treeId) {
        this.id = treeId;
    }

    @Override
    public Long treeParentId() {
        return this.parentId;
    }

    @Override
    public void treeParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Override
    public List<DeptResp> children() {
        return this.children;
    }

    @Override
    public String name() {
        return this.title;
    }

    @Override
    public void children(List<DeptResp> children) {
        this.children = children;
    }
}
